Skip to content

feat(mapgen-studio): add canonical token-driven shadcn primitive library with Radix UI and sonner#1606

Merged
mateicanavra merged 1 commit into
mainfrom
design/ui-primitives
Jun 12, 2026
Merged

feat(mapgen-studio): add canonical token-driven shadcn primitive library with Radix UI and sonner#1606
mateicanavra merged 1 commit into
mainfrom
design/ui-primitives

Conversation

@mateicanavra

Copy link
Copy Markdown
Owner

Introduces a canonical token-driven shadcn primitive library for MapGen Studio at src/components/ui/, providing the foundational building blocks the redesign assembles from. This is an additive change — no existing call sites are migrated.

Primitives added: Button, Input, Textarea, Label, Select, Switch, Checkbox, Tooltip, Dialog, DropdownMenu, Popover, Tabs, Separator, ScrollArea, and a Sonner-based Toaster. All are barrel-exported from src/components/ui/index.ts.

Token discipline: Every primitive is styled exclusively through the existing design system tokens (bg-popover, border-border, text-foreground, ring, etc.). No hex literals, no dark: variants, no lightMode prop. Theming flips via the single .dark class on <html>; the Toaster reads that class through a MutationObserver rather than next-themes or prefers-color-scheme.

Depth and density: Shadows appear only on floating layers (dialog, popover, dropdown, tooltip, select content, toast), which also take the 8px radius. In-surface controls use the 4px radius. Dense as-built dimensions are preserved: Button h-8/h-7, Input h-7 at 11px, Switch 36×20. Focus renders as a 1px --ring luminance contour. The active Tab is marked by a thin primary underline rule, not a filled slab.

Named type scale: Adds --text-data (11px) and --text-label (10px) as @theme font-size tokens in index.css. Extends the cn tailwind-merge instance to register these in the font-size class group, preventing a co-applied text color utility from clobbering the font size.

Dependencies added: Twelve Radix UI primitive packages and sonner.

@github-actions

Copy link
Copy Markdown

Railway preview (MapGen Studio): not provisioned for this PR.

Policy (Graphite stacks): previews are created only for the top-of-stack PR by default.

  • To force a preview for this PR: add label railway-preview
  • To suppress a preview: add label no-railway-preview

Debug: {"isClosed":false,"isFork":false,"suppress":false,"force":false,"isTopOfStack":false,"hasToken":true,"draft":false}

mateicanavra commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

This was referenced Jun 12, 2026

mateicanavra commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

Merge activity

  • Jun 12, 8:50 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 12, 8:54 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 12, 8:54 PM UTC: @mateicanavra merged this pull request with Graphite.

@mateicanavra
mateicanavra changed the base branch from design/control-seam to graphite-base/1606 June 12, 2026 20:51
@mateicanavra
mateicanavra changed the base branch from graphite-base/1606 to main June 12, 2026 20:52
Add the canonical primitive library at src/components/ui/ built ON the
existing design tokens + cn: button, input, textarea, label, select, switch,
checkbox, tooltip, dialog, dropdown-menu, popover, tabs, separator,
scroll-area, sonner. Token-driven only (no hex palettes, no lightMode prop,
no prefers-color-scheme); dense as-built dimensions (Button h-8/h-7, Input
h-7 11px, Switch 36x20) and the contour-luminance focus signature. Add the
named type scale tokens (--text-data/--text-label) and register them in cn's
tailwind-merge font-size group so a color utility can't clobber the size.
Additive: no existing call site is swapped. OpenSpec:
mapgen-studio-ui-primitives.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mateicanavra
mateicanavra force-pushed the design/ui-primitives branch from 91a0376 to b13ff7b Compare June 12, 2026 20:53
@mateicanavra
mateicanavra merged commit 7a3afcf into main Jun 12, 2026
0 of 3 checks passed
This was referenced Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant